﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Security;


namespace VideoWorld
{
    public class login : System.Web.UI.Page
    {
        protected System.Web.UI.WebControls.TextBox cardNumber;
        protected System.Web.UI.WebControls.TextBox testCode;
        protected System.Web.UI.WebControls.Image Image1;
        protected System.Web.UI.WebControls.CheckBox savePassword;
        protected System.Web.UI.WebControls.Button regTrue;
        protected System.Web.UI.WebControls.Button reg;
        protected System.Web.UI.HtmlControls.HtmlTable tableReg;
        protected System.Web.UI.HtmlControls.HtmlTable tableNavi;
        protected System.Web.UI.WebControls.Button findPassword;
        protected System.Web.UI.WebControls.TextBox name;
        protected System.Web.UI.WebControls.TextBox password;
        protected System.Web.UI.WebControls.Label ErrorInfo;
        DataAccess.Users users = new DataAccess.Users(Global.ConnectionString);
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                String newError = Request.QueryString["error"];
                if (newError == null)
                {
                    ErrorInfo.Text = String.Format("提示：请认真填写以下信息");
                }
                else
                {
                    ErrorInfo.Text = newError;

                }
                if (Request["ErrorInfo"] != null)
                {
                    ErrorInfo.Text = Request["ErrorInfo"];
                    tableNavi.Visible = true;
                    tableReg.Visible = false;
                    if (Request["ErrorInfo"] == "你输入的密码不正确!")
                    {
                        tableReg.Visible = true;
                        tableNavi.Visible = false;
                    }
                }
                //登录成功后屏蔽登录界面
                else
                {
                    tableReg.Visible = true;
                    tableNavi.Visible = false;
                }

            }

        }

        #region Web Form Designer generated code
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
            base.OnInit(e);
        }

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.Load += new System.EventHandler(this.Page_Load);

        }
        #endregion
    }
}
